package com.example.jpatest.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.*;

/**
 * 队伍老师联系实体类
 * @author czx
 */

@Data
@ToString(exclude = {"teacher","team"})
@EqualsAndHashCode(exclude = {"teacher","team"})
@Entity
public class TeamTeacher {

    public static enum TeacherLevel{
        /**
         * 第一老师
         */
        FIRST,
        /**
         * 第二老师
         */
        SECOND,
        /**
         * 其他
         */
        OTHER
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 老师
     */
    @ManyToOne
    @JsonIgnore
    private Teacher teacher;

    /**
     * 队伍
     */
    @ManyToOne
    @JsonIgnore
    private Team team;

    /**
     * 老师等级
     */
    private TeacherLevel teacherLevel;
}
